<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <script>
      var old = Date.now();

      var a = [20, 5, 98, 12, 32, 9, 1];
      for (i = 1; i < a.length; i++) {
        for (j = 0; j < a.length - i; j++) {
          if (a[j] > a[j + 1]) {
            var temp = a[j];
            a[j] = a[j + 1];
            a[j + 1] = temp;
          }
        }
      }
      var ne = Date.now();
      console.log(a);
      // console.log(Date.now());
      // var c = Boolean(1>undefined);
      // console.log(c);
      console.log(ne - old);
    </script>
  </body>
</html>
